<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>margin 重合解决</title>
    <!--    解决方法， 将中间那个article触发BFC-->
    <style>
        article {
            width: 100px;
            height: 100px;
            background-color: cyan;
            margin: 10px;
        }
        /*使用overflow:hidden进行BFC实现，margin就不会重叠了*/
        main{
            overflow: hidden;
        }

        div{
            overflow: hidden;
        }
        article:nth-child(1){
            background: linear-gradient(
                    -50deg,
                    #F7A37B,
                    #F7A37B,
                    #FFDEA8,
                    #FFDEA8 20%,
                    #D0E4B0,
                    #D0E4B0,
                    #00A2E1 20%,
                    #00A2E1,
                    #0085C8,
                    #0085C8
            );

        }
    </style>
</head>
<body>
<article></article>
<!--这玩意儿就是一个BFC-->
<main>
    <article></article>
</main>
<article></article>
</body>
</html>
